<?php

namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;
use App\Http\Controllers\AdminController;
use Illuminate\Support\Facades\DB;
use App\Model\{Admin,User,Config};

/**
 * @menu_cat 内容分类
 * @icon sunglasses
 * @sort 30
 */
class TypeController extends AdminController{
	public function __construct(){
		parent::__construct();
		
		view()->share('admin_group', Config::get_config_bykey('admin_group'));
		view()->share('admin_status_config', Config::get_config_bykey('admin_status'));
	}
	
	public function __invoke(){
		return $this->index(func_get_args());
	}

	/**
	 * @menu 文章分类
	 * @return [type] [description]
	 */
	public function index(){
		$list = DB::table('typedata')->paginate(15);
		return view('Admin.Type.index')->with([
				'list' => $list,
		]);
	}

	/**
	 * @menu 视频分类
	 * @return [type] [description]
	 */
	public function video_index(){
		$list = DB::table('typedata_video')->paginate(15);
		return view('Admin.Type.index')->with([
				'list' => $list,
		]);
	}

}